{extend name="public/base" /} {block name="body"}
<div class="content-tabs">
	<ol class="breadcrumb">
		<li>
			<a href="{:url('index/index')}"><i class="fa fa-home"></i></a>
		</li>
		<li>
			<a href="{:url('index')}">优惠券管理</a>
		</li>
		<li><strong>发放优惠券</strong></li>
	</ol>
</div>
<div class="ibox float-e-margins">
	<div class="ibox-content">
		<form id="myForm" class="form-horizontal m-t" method="post" action="{:url('grant')}">	
			<div class="form-group" style="padding-left: 20px;">
					会员卡号 <input type="text" id="member_no" name="member_no" value="" placeholder="请输入会员卡号" class="bank" />
					姓名 <input type="text" id="membername" name="membername" value="" placeholder="请输入姓名" class="bank" />
		     		手机号 <input type="text" id="mobile" name="mobile" value="" placeholder="请输入手机号" class="bank" />
		     		有效期 <input id='start_time' name='start_time'  style="width: 160px;" onclick='WdatePicker()' type='text' placeholder="开始时间" class="bank" />	
					至<input id='end_time' name='end_time'  style="width: 160px;" onclick='WdatePicker()' type='text' placeholder="结束时间" class="bank" />
					<span class="bank"><button type="submit" class="btn btn-sm btn-primary"><li class="fa fa-search"> 查询</li></button> </span>
			</div>	
		</from>
		<div class="hr-line-dashed"></div>
            <div class="example-wrap">
				<div class="example">				
					<table class="table table-bordered table-hover">
						<thead>
							<tr class="long-th">    
                            	<th>卡号</th>
                                <th>姓名</th>
                                <th>手机号</th>
                                <th>等级</th>
								<th>积分</th>
								<th>余额</th>
								<th>状态</th>
								<th>操作</th>
                            </tr>
                        </thead>
                        <tbody id="list">
                        	{volist name="list" id='ad'}
                        	<tr style="text-align: center;">
                        		<td>{$ad.member_no}</td>
                        		<td>{$ad.membername}</td>
                        		<td>{$ad.mobile}</td>
                        		<td>
                        			{if $ad.member_gradeid == 0}
                        			会员默认等级
                        			{else}
                        			一级
                        			{/if}
                        		</td>
								<td>{$ad.total_score}</td>
                        		<td>{$ad.newblanceflg}</td>
                        		<td>
                        			{if $ad.status == 1}
                        			正常
                        			{else}
                        			异常
                        			{/if}
                        		</td>
                        		<td class="text-center">
									<a href="{:url('grantclick',['id'=>$ad.id,'couponid'=>$couponid])}" class="btn btn-primary bnt-sm ajax-do">
										<i class="fa fa-paste"></i> 发放</a>
								</td>
                        	</tr>
                        	{/volist}
                        </tbody>
                    </table>
                    <div style="text-align: right;">
                      {$list->render()}
                    </div>
                </div>
           	</div>           
            </div>
</div>
{/block} {block name="script"}
<script src="__LIB__/datepicker/WdatePicker.js"></script>
<script src="__JS__/jquery.form.js"></script>
<script src="__LIB__/datepicker/WdatePicker.js"></script>
<script src="__LIB__/validate/jquery.validate.min.js"></script>
<script src="__LIB__/validate/messages_zh.min.js"></script>
<script src="__LIB__/validate/add_validate.min.js"></script>
<script src="__LIB__/fileinput/js/fileinput.min.js"></script>
<script src="__LIB__/fileinput/js/locales/zh.js"></script>
<script>
	$(function() {
		$("#myForm").validate({
			rules: {
			},
			messages: {
			},
			submitHandler: function(form) {
				ajaxForm();
			}
		});
	});
</script>
<style>
.bank{
	width: 150px;
    height:30px;
    text-align:center;
    border-radius:5px;
}
</style>
{/block}